package com.ellecity06.common.ktx

import androidx.core.content.ContextCompat
import com.ellecity06.common.utils.appContext

/**
 * @author ellecity06
 * @time 2024/10/28 10:25
 * @des
 */

/**
 * StringRes转换成String
 */
fun Int.stringResToString(): String = appContext.resources.getString(this)

/**
 * ColorRes转ColorId
 */
fun Int.colorResToColorId(): Int = ContextCompat.getColor(appContext, this)

/**
 * DimenRes转Int
 */
fun Int.dimenResToInt(): Int = appContext.resources.getDimensionPixelSize(this)

/**
 * DimenRes转Float
 */
fun Int.dimenResToFloat(): Float = appContext.resources.getDimension(this)